package top.yueyazhui.storage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import top.yueyazhui.storage.entity.Storage;

@Mapper
public interface StorageMapper {

    @Select("select * from storage_tbl where commodity_code = #{commodityCode}")
    Storage getCountByCommodityCode(@Param("commodityCode") String commodityCode);

    @Update("update storage_tbl set count = #{count}, freeze_count = #{freezeCount} where commodity_code = #{commodityCode}")
    Integer updateStorage(Storage storage);
}
